#ifndef SHANGHAI_SUBWAY_MEDIACLASS_H
#define SHANGHAI_SUBWAY_MEDIACLASS_H

#include <QObject>
#include "Graph.h"
#include "fstream"

class MediaClass : public QObject{
    Q_OBJECT
    Q_PROPERTY(std::string source READ source WRITE setSource NOTIFY sourceChanged)
    Q_PROPERTY(std::string dest READ dest WRITE setDest NOTIFY destChanged)
    Q_PROPERTY(QList<QString> list READ list)

public:

    void fileInput(Graph & subway, int i){
        std::string site1, site2;
        double power;
        std::fstream fin;
        char inputFile[50];
        sprintf(inputFile, "/home/liuyang/Code/Shanghai_Subway/Data/Line%d.dat", i);
        std::string filePath(inputFile);
        fin.open(inputFile);
        if (fin.is_open()) {
            fin >> site1;
            subway.addVertex(site1,subway.LINE[i]);
            while (!fin.eof()) {
                fin >> power >> site2;
                subway.addVertex(site2,subway.LINE[i]);
                subway.addEdge(site1,site2,power);
                site1 = site2;
            }
            fin.close();
        } else {
            std::cout << "File Open Failed, File:" << i << std::endl;
        }
    }

    void fileInput(Graph & subway, const char * inputFile, int i){
        std::string site1, site2;
        double power;
        std::fstream fin;
        std::string filePath(inputFile);
        fin.open(inputFile);
        if (fin.is_open()) {
            fin >> site1;
            subway.addVertex(site1,subway.LINE[i]);
            while (!fin.eof()) {
                fin >> power >> site2;
                subway.addVertex(site2,subway.LINE[i]);
                subway.addEdge(site1,site2,power);
                site1 = site2;
            }
            fin.close();
        } else {
            std::cout << "File Open Failed, File:" << i << std::endl;
        }
    }

    void buildVertex(Graph & subway) {
        subway.addVertex("嘉定北",subway.LINE[11]);
        subway.addVertex("嘉定西",subway.LINE[11]);
        subway.addVertex("嘉定西",subway.LINE[11]);
        subway.addVertex("白银路",subway.LINE[11]);
        subway.addVertex("白银路",subway.LINE[11]);
        subway.addVertex("嘉定新城",subway.LINE[11]);
        subway.addVertex("嘉定新城",subway.LINE[11]);
        subway.addVertex("嘉定新城",subway.LINE[11]);
        subway.addVertex("上海赛车场",subway.LINE[11]);
        subway.addVertex("上海赛车场",subway.LINE[11]);
        subway.addVertex("昌吉东路",subway.LINE[11]);
        subway.addVertex("昌吉东路",subway.LINE[11]);
        subway.addVertex("上海汽车城",subway.LINE[11]);
        subway.addVertex("上海汽车城",subway.LINE[11]);
        subway.addVertex("安亭",subway.LINE[11]);
        subway.addVertex("马陆",subway.LINE[11]);
        subway.addVertex("马陆",subway.LINE[11]);
        subway.addVertex("南翔",subway.LINE[11]);
        subway.addVertex("南翔",subway.LINE[11]);
        subway.addVertex("桃浦新村",subway.LINE[11]);
        subway.addVertex("桃浦新村",subway.LINE[11]);
        subway.addVertex("武威路",subway.LINE[11]);
        subway.addVertex("武威路",subway.LINE[11]);
        subway.addVertex("祁连山路",subway.LINE[11]);
        subway.addVertex("祁连山路",subway.LINE[11]);
        subway.addVertex("李子园",subway.LINE[11]);
        subway.addVertex("李子园",subway.LINE[11]);
        subway.addVertex("上海西站",subway.LINE[11]);
        subway.addVertex("上海西站",subway.LINE[11]);
        subway.addVertex("真如",subway.LINE[11]);
        subway.addVertex("真如",subway.LINE[11]);
        subway.addVertex("枫桥路",subway.LINE[11]);
        subway.addVertex("枫桥路",subway.LINE[11]);
        subway.addVertex("曹杨路",subway.LINE[11]);
        subway.addVertex("曹杨路",subway.LINE[11]);
        subway.addVertex("曹杨路",subway.LINE[4]);
        subway.addVertex("曹杨路",subway.LINE[4]);
        subway.addVertex("曹杨路",subway.LINE[3]);
        subway.addVertex("曹杨路",subway.LINE[3]);
        subway.addVertex("隆德路",subway.LINE[11]);
        subway.addVertex("隆德路",subway.LINE[11]);
        subway.addVertex("江苏路",subway.LINE[11]);
        subway.addVertex("江苏路",subway.LINE[2]);
        subway.addVertex("江苏路",subway.LINE[2]);
        subway.addVertex("美兰湖",subway.LINE[7]);
        subway.addVertex("罗南新村",subway.LINE[7]);
        subway.addVertex("罗南新村",subway.LINE[7]);
        subway.addVertex("潘广路",subway.LINE[7]);
        subway.addVertex("潘广路",subway.LINE[7]);
        subway.addVertex("刘行",subway.LINE[7]);
        subway.addVertex("刘行",subway.LINE[7]);
        subway.addVertex("顾村公园",subway.LINE[7]);
        subway.addVertex("顾村公园",subway.LINE[7]);
        subway.addVertex("祁华路",subway.LINE[7]);
        subway.addVertex("祁华路",subway.LINE[7]);
        subway.addVertex("上海大学",subway.LINE[7]);
        subway.addVertex("上海大学",subway.LINE[7]);
        subway.addVertex("南陈路",subway.LINE[7]);
        subway.addVertex("南陈路",subway.LINE[7]);
        subway.addVertex("上大路",subway.LINE[7]);
        subway.addVertex("上大路",subway.LINE[7]);
        subway.addVertex("场中路",subway.LINE[7]);
        subway.addVertex("场中路",subway.LINE[7]);
        subway.addVertex("大场镇",subway.LINE[7]);
        subway.addVertex("大场镇",subway.LINE[7]);
        subway.addVertex("行知路",subway.LINE[7]);
        subway.addVertex("行知路",subway.LINE[7]);
        subway.addVertex("大华三路",subway.LINE[7]);
        subway.addVertex("大华三路",subway.LINE[7]);
        subway.addVertex("新村路",subway.LINE[7]);
        subway.addVertex("新村路",subway.LINE[7]);
        subway.addVertex("岚皋路",subway.LINE[7]);
        subway.addVertex("岚皋路",subway.LINE[7]);
        subway.addVertex("镇坪路",subway.LINE[7]);
        subway.addVertex("镇坪路",subway.LINE[7]);
        subway.addVertex("镇坪路",subway.LINE[4]);
        subway.addVertex("镇坪路",subway.LINE[3]);
        subway.addVertex("镇坪路",subway.LINE[4]);
        subway.addVertex("镇坪路",subway.LINE[3]);
        subway.addVertex("长寿路",subway.LINE[7]);
        subway.addVertex("长寿路",subway.LINE[7]);
        subway.addVertex("昌平路",subway.LINE[7]);
        subway.addVertex("昌平路",subway.LINE[7]);
        subway.addVertex("静安寺",subway.LINE[7]);
        subway.addVertex("静安寺",subway.LINE[7]);
        subway.addVertex("静安寺",subway.LINE[2]);
        subway.addVertex("静安寺",subway.LINE[2]);
        subway.addVertex("常熟路",subway.LINE[7]);
        subway.addVertex("常熟路",subway.LINE[7]);
        subway.addVertex("常熟路",subway.LINE[1]);
        subway.addVertex("常熟路",subway.LINE[1]);
        subway.addVertex("肇家浜路",subway.LINE[7]);
        subway.addVertex("肇家浜路",subway.LINE[7]);
        subway.addVertex("肇家浜路",subway.LINE[9]);
        subway.addVertex("肇家浜路",subway.LINE[9]);
        subway.addVertex("东安路",subway.LINE[7]);
        subway.addVertex("东安路",subway.LINE[7]);
        subway.addVertex("东安路",subway.LINE[4]);
        subway.addVertex("东安路",subway.LINE[4]);
        subway.addVertex("船厂路",subway.LINE[7]);
        subway.addVertex("船厂路",subway.LINE[7]);
        subway.addVertex("后滩",subway.LINE[7]);
        subway.addVertex("后滩",subway.LINE[7]);
        subway.addVertex("长清路",subway.LINE[7]);
        subway.addVertex("长清路",subway.LINE[7]);
        subway.addVertex("耀华路",subway.LINE[7]);
        subway.addVertex("耀华路",subway.LINE[7]);
        subway.addVertex("耀华路",subway.LINE[8]);
        subway.addVertex("耀华路",subway.LINE[8]);
        subway.addVertex("云台路",subway.LINE[7]);
        subway.addVertex("云台路",subway.LINE[7]);
        subway.addVertex("高科西路",subway.LINE[7]);
        subway.addVertex("高科西路",subway.LINE[7]);
        subway.addVertex("高科西路",subway.LINE[6]);
        subway.addVertex("高科西路",subway.LINE[6]);
        subway.addVertex("杨高南路",subway.LINE[7]);
        subway.addVertex("杨高南路",subway.LINE[7]);
        subway.addVertex("锦绣路",subway.LINE[7]);
        subway.addVertex("锦绣路",subway.LINE[7]);
        subway.addVertex("芳华路",subway.LINE[7]);
        subway.addVertex("芳华路",subway.LINE[7]);
        subway.addVertex("龙阳路",subway.LINE[7]);
        subway.addVertex("龙阳路",subway.LINE[7]);
        subway.addVertex("龙阳路",subway.LINE[2]);
        subway.addVertex("龙阳路",subway.LINE[2]);
        subway.addVertex("花木路",subway.LINE[7]);
        subway.addVertex("中潭路",subway.LINE[4]);
        subway.addVertex("中潭路",subway.LINE[3]);
        subway.addVertex("中潭路",subway.LINE[4]);
        subway.addVertex("中潭路",subway.LINE[3]);
        subway.addVertex("上海火车站",subway.LINE[4]);
        subway.addVertex("上海火车站",subway.LINE[1]);
        subway.addVertex("上海火车站",subway.LINE[1]);
        subway.addVertex("上海火车站",subway.LINE[3]);
        subway.addVertex("上海火车站",subway.LINE[4]);
        subway.addVertex("上海火车站",subway.LINE[3]);
        subway.addVertex("宝山路",subway.LINE[4]);
        subway.addVertex("宝山路",subway.LINE[4]);
        subway.addVertex("宝山路",subway.LINE[3]);
        subway.addVertex("宝山路",subway.LINE[3]);
        subway.addVertex("海伦路",subway.LINE[4]);
        subway.addVertex("海伦路",subway.LINE[4]);
        subway.addVertex("海伦路",subway.LINE[10]);
        subway.addVertex("海伦路",subway.LINE[10]);
        subway.addVertex("临平路",subway.LINE[4]);
        subway.addVertex("临平路",subway.LINE[4]);
        subway.addVertex("大连路",subway.LINE[4]);
        subway.addVertex("大连路",subway.LINE[4]);
        subway.addVertex("杨树浦路",subway.LINE[4]);
        subway.addVertex("杨树浦路",subway.LINE[4]);
        subway.addVertex("浦东大道",subway.LINE[4]);
        subway.addVertex("浦东大道",subway.LINE[4]);
        subway.addVertex("世纪大道",subway.LINE[4]);
        subway.addVertex("世纪大道",subway.LINE[4]);
        subway.addVertex("世纪大道",subway.LINE[2]);
        subway.addVertex("世纪大道",subway.LINE[2]);
        subway.addVertex("世纪大道",subway.LINE[9]);
        subway.addVertex("世纪大道",subway.LINE[9]);
        subway.addVertex("世纪大道",subway.LINE[6]);
        subway.addVertex("世纪大道",subway.LINE[6]);
        subway.addVertex("浦电路",subway.LINE[4]);
        subway.addVertex("浦电路",subway.LINE[4]);
        subway.addVertex("蓝村路",subway.LINE[4]);
        subway.addVertex("蓝村路",subway.LINE[4]);
        subway.addVertex("蓝村路",subway.LINE[6]);
        subway.addVertex("蓝村路",subway.LINE[6]);
        subway.addVertex("塘桥",subway.LINE[4]);
        subway.addVertex("塘桥",subway.LINE[4]);
        subway.addVertex("南浦大桥",subway.LINE[4]);
        subway.addVertex("南浦大桥",subway.LINE[4]);
        subway.addVertex("西藏南路",subway.LINE[4]);
        subway.addVertex("西藏南路",subway.LINE[4]);
        subway.addVertex("西藏南路",subway.LINE[8]);
        subway.addVertex("西藏南路",subway.LINE[8]);
        subway.addVertex("鲁班路",subway.LINE[4]);
        subway.addVertex("鲁班路",subway.LINE[4]);
        subway.addVertex("大木桥路",subway.LINE[4]);
        subway.addVertex("大木桥路",subway.LINE[4]);
        subway.addVertex("上海体育场",subway.LINE[4]);
        subway.addVertex("上海体育场",subway.LINE[4]);
        subway.addVertex("上海体育馆",subway.LINE[4]);
        subway.addVertex("上海体育馆",subway.LINE[4]);
        subway.addVertex("上海体育馆",subway.LINE[1]);
        subway.addVertex("上海体育馆",subway.LINE[1]);
        subway.addVertex("宜山路",subway.LINE[4]);
        subway.addVertex("宜山路",subway.LINE[4]);
        subway.addVertex("宜山路",subway.LINE[9]);
        subway.addVertex("宜山路",subway.LINE[9]);
        subway.addVertex("宜山路",subway.LINE[3]);
        subway.addVertex("宜山路",subway.LINE[3]);
        subway.addVertex("虹桥路",subway.LINE[4]);
        subway.addVertex("虹桥路",subway.LINE[4]);
        subway.addVertex("虹桥路",subway.LINE[10]);
        subway.addVertex("虹桥路",subway.LINE[10]);
        subway.addVertex("虹桥路",subway.LINE[3]);
        subway.addVertex("虹桥路",subway.LINE[3]);
        subway.addVertex("延安西路",subway.LINE[4]);
        subway.addVertex("延安西路",subway.LINE[4]);
        subway.addVertex("延安西路",subway.LINE[3]);
        subway.addVertex("延安西路",subway.LINE[3]);
        subway.addVertex("中山公园",subway.LINE[4]);
        subway.addVertex("中山公园",subway.LINE[4]);
        subway.addVertex("中山公园",subway.LINE[2]);
        subway.addVertex("中山公园",subway.LINE[2]);
        subway.addVertex("中山公园",subway.LINE[3]);
        subway.addVertex("中山公园",subway.LINE[3]);
        subway.addVertex("金沙江路",subway.LINE[4]);
        subway.addVertex("金沙江路",subway.LINE[4]);
        subway.addVertex("金沙江路",subway.LINE[3]);
        subway.addVertex("金沙江路",subway.LINE[3]);
        subway.addVertex("南京西路",subway.LINE[2]);
        subway.addVertex("南京西路",subway.LINE[2]);
        subway.addVertex("人民广场",subway.LINE[2]);
        subway.addVertex("人民广场",subway.LINE[2]);
        subway.addVertex("人民广场",subway.LINE[1]);
        subway.addVertex("人民广场",subway.LINE[1]);
        subway.addVertex("人民广场",subway.LINE[8]);
        subway.addVertex("人民广场",subway.LINE[8]);
        subway.addVertex("南京东路",subway.LINE[2]);
        subway.addVertex("南京东路",subway.LINE[2]);
        subway.addVertex("南京东路",subway.LINE[10]);
        subway.addVertex("南京东路",subway.LINE[10]);
        subway.addVertex("陆家嘴",subway.LINE[2]);
        subway.addVertex("陆家嘴",subway.LINE[2]);
        subway.addVertex("东昌路",subway.LINE[2]);
        subway.addVertex("东昌路",subway.LINE[2]);
        subway.addVertex("娄山关路",subway.LINE[2]);
        subway.addVertex("娄山关路",subway.LINE[2]);
        subway.addVertex("威宁路",subway.LINE[2]);
        subway.addVertex("威宁路",subway.LINE[2]);
        subway.addVertex("北新泾",subway.LINE[2]);
        subway.addVertex("北新泾",subway.LINE[2]);
        subway.addVertex("淞虹路",subway.LINE[2]);
        subway.addVertex("淞虹路",subway.LINE[2]);
        subway.addVertex("虹桥2号航站楼",subway.LINE[2]);
        subway.addVertex("虹桥2号航站楼",subway.LINE[2]);
        subway.addVertex("虹桥2号航站楼",subway.LINE[10]);
        subway.addVertex("虹桥火车站",subway.LINE[2]);
        subway.addVertex("虹桥火车站",subway.LINE[2]);
        subway.addVertex("徐泾东",subway.LINE[2]);
        subway.addVertex("上海科技馆",subway.LINE[2]);
        subway.addVertex("上海科技馆",subway.LINE[2]);
        subway.addVertex("世纪公园",subway.LINE[2]);
        subway.addVertex("世纪公园",subway.LINE[2]);
        subway.addVertex("张江高科",subway.LINE[2]);
        subway.addVertex("张江高科",subway.LINE[2]);
        subway.addVertex("金科路",subway.LINE[2]);
        subway.addVertex("金科路",subway.LINE[2]);
        subway.addVertex("唐镇",subway.LINE[2]);
        subway.addVertex("唐镇",subway.LINE[2]);
        subway.addVertex("广兰路",subway.LINE[2]);
        subway.addVertex("广兰路",subway.LINE[2]);
        subway.addVertex("创新中路",subway.LINE[2]);
        subway.addVertex("创新中路",subway.LINE[2]);
        subway.addVertex("华夏东路",subway.LINE[2]);
        subway.addVertex("华夏东路",subway.LINE[2]);
        subway.addVertex("川沙",subway.LINE[2]);
        subway.addVertex("川沙",subway.LINE[2]);
        subway.addVertex("凌空路",subway.LINE[2]);
        subway.addVertex("凌空路",subway.LINE[2]);
        subway.addVertex("远东大道",subway.LINE[2]);
        subway.addVertex("远东大道",subway.LINE[2]);
        subway.addVertex("海天三路",subway.LINE[2]);
        subway.addVertex("海天三路",subway.LINE[2]);
        subway.addVertex("浦东国际机场",subway.LINE[2]);
        subway.addVertex("富锦路",subway.LINE[1]);
        subway.addVertex("友谊西路",subway.LINE[1]);
        subway.addVertex("友谊西路",subway.LINE[1]);
        subway.addVertex("宝安公路",subway.LINE[1]);
        subway.addVertex("宝安公路",subway.LINE[1]);
        subway.addVertex("共富新村",subway.LINE[1]);
        subway.addVertex("共富新村",subway.LINE[1]);
        subway.addVertex("呼兰路",subway.LINE[1]);
        subway.addVertex("呼兰路",subway.LINE[1]);
        subway.addVertex("通河新村",subway.LINE[1]);
        subway.addVertex("通河新村",subway.LINE[1]);
        subway.addVertex("共康路",subway.LINE[1]);
        subway.addVertex("共康路",subway.LINE[1]);
        subway.addVertex("彭浦新村",subway.LINE[1]);
        subway.addVertex("彭浦新村",subway.LINE[1]);
        subway.addVertex("汶水路",subway.LINE[1]);
        subway.addVertex("汶水路",subway.LINE[1]);
        subway.addVertex("上海马戏城",subway.LINE[1]);
        subway.addVertex("上海马戏城",subway.LINE[1]);
        subway.addVertex("延长路",subway.LINE[1]);
        subway.addVertex("延长路",subway.LINE[1]);
        subway.addVertex("中山北路",subway.LINE[1]);
        subway.addVertex("中山北路",subway.LINE[1]);
        subway.addVertex("汉中路",subway.LINE[1]);
        subway.addVertex("汉中路",subway.LINE[1]);
        subway.addVertex("新闸路",subway.LINE[1]);
        subway.addVertex("新闸路",subway.LINE[1]);
        subway.addVertex("黄陂南路",subway.LINE[1]);
        subway.addVertex("黄陂南路",subway.LINE[1]);
        subway.addVertex("陕西南路",subway.LINE[1]);
        subway.addVertex("陕西南路",subway.LINE[1]);
        subway.addVertex("陕西南路",subway.LINE[10]);
        subway.addVertex("陕西南路",subway.LINE[10]);
        subway.addVertex("衡山路",subway.LINE[1]);
        subway.addVertex("衡山路",subway.LINE[1]);
        subway.addVertex("徐家汇",subway.LINE[1]);
        subway.addVertex("徐家汇",subway.LINE[1]);
        subway.addVertex("徐家汇",subway.LINE[9]);
        subway.addVertex("徐家汇",subway.LINE[9]);
        subway.addVertex("漕宝路",subway.LINE[1]);
        subway.addVertex("漕宝路",subway.LINE[1]);
        subway.addVertex("上海南站",subway.LINE[1]);
        subway.addVertex("上海南站",subway.LINE[1]);
        subway.addVertex("上海南站",subway.LINE[3]);
        subway.addVertex("锦江乐园",subway.LINE[1]);
        subway.addVertex("锦江乐园",subway.LINE[1]);
        subway.addVertex("莲花路",subway.LINE[1]);
        subway.addVertex("莲花路",subway.LINE[1]);
        subway.addVertex("外环路",subway.LINE[1]);
        subway.addVertex("外环路",subway.LINE[1]);
        subway.addVertex("莘庄",subway.LINE[1]);
        subway.addVertex("莘庄",subway.LINE[5]);
        subway.addVertex("嘉善路",subway.LINE[9]);
        subway.addVertex("嘉善路",subway.LINE[9]);
        subway.addVertex("打浦桥",subway.LINE[9]);
        subway.addVertex("打浦桥",subway.LINE[9]);
        subway.addVertex("马当路",subway.LINE[9]);
        subway.addVertex("马当路",subway.LINE[9]);
        subway.addVertex("陆家浜路",subway.LINE[9]);
        subway.addVertex("陆家浜路",subway.LINE[9]);
        subway.addVertex("陆家浜路",subway.LINE[8]);
        subway.addVertex("陆家浜路",subway.LINE[8]);
        subway.addVertex("小南门",subway.LINE[9]);
        subway.addVertex("小南门",subway.LINE[9]);
        subway.addVertex("商城路",subway.LINE[9]);
        subway.addVertex("商城路",subway.LINE[9]);
        subway.addVertex("桂林路",subway.LINE[9]);
        subway.addVertex("桂林路",subway.LINE[9]);
        subway.addVertex("漕河泾开发区",subway.LINE[9]);
        subway.addVertex("漕河泾开发区",subway.LINE[9]);
        subway.addVertex("合川路",subway.LINE[9]);
        subway.addVertex("合川路",subway.LINE[9]);
        subway.addVertex("星中路",subway.LINE[9]);
        subway.addVertex("星中路",subway.LINE[9]);
        subway.addVertex("七宝",subway.LINE[9]);
        subway.addVertex("七宝",subway.LINE[9]);
        subway.addVertex("中春路",subway.LINE[9]);
        subway.addVertex("中春路",subway.LINE[9]);
        subway.addVertex("九亭",subway.LINE[9]);
        subway.addVertex("九亭",subway.LINE[9]);
        subway.addVertex("泗泾",subway.LINE[9]);
        subway.addVertex("泗泾",subway.LINE[9]);
        subway.addVertex("佘山",subway.LINE[9]);
        subway.addVertex("佘山",subway.LINE[9]);
        subway.addVertex("洞泾",subway.LINE[9]);
        subway.addVertex("洞泾",subway.LINE[9]);
        subway.addVertex("松江大学城",subway.LINE[9]);
        subway.addVertex("松江大学城",subway.LINE[9]);
        subway.addVertex("松江新城",subway.LINE[9]);
        subway.addVertex("春申路",subway.LINE[5]);
        subway.addVertex("春申路",subway.LINE[5]);
        subway.addVertex("银都路",subway.LINE[5]);
        subway.addVertex("银都路",subway.LINE[5]);
        subway.addVertex("颛桥",subway.LINE[5]);
        subway.addVertex("颛桥",subway.LINE[5]);
        subway.addVertex("北桥",subway.LINE[5]);
        subway.addVertex("北桥",subway.LINE[5]);
        subway.addVertex("剑川路",subway.LINE[5]);
        subway.addVertex("剑川路",subway.LINE[5]);
        subway.addVertex("东川路",subway.LINE[5]);
        subway.addVertex("东川路",subway.LINE[5]);
        subway.addVertex("金平路",subway.LINE[5]);
        subway.addVertex("金平路",subway.LINE[5]);
        subway.addVertex("华宁路",subway.LINE[5]);
        subway.addVertex("华宁路",subway.LINE[5]);
        subway.addVertex("闵行开发区",subway.LINE[5]);
        subway.addVertex("文井路",subway.LINE[5]);
        subway.addVertex("文井路",subway.LINE[5]);
        subway.addVertex("杨高中路",subway.LINE[9]);
        subway.addVertex("中兴路",subway.LINE[8]);
        subway.addVertex("中兴路",subway.LINE[8]);
        subway.addVertex("西藏北路",subway.LINE[8]);
        subway.addVertex("西藏北路",subway.LINE[8]);
        subway.addVertex("曲阜路",subway.LINE[8]);
        subway.addVertex("曲阜路",subway.LINE[8]);
        subway.addVertex("虹口足球场",subway.LINE[8]);
        subway.addVertex("虹口足球场",subway.LINE[8]);
        subway.addVertex("虹口足球场",subway.LINE[3]);
        subway.addVertex("虹口足球场",subway.LINE[3]);
        subway.addVertex("曲阳路",subway.LINE[8]);
        subway.addVertex("曲阳路",subway.LINE[8]);
        subway.addVertex("四平路",subway.LINE[8]);
        subway.addVertex("四平路",subway.LINE[8]);
        subway.addVertex("四平路",subway.LINE[10]);
        subway.addVertex("四平路",subway.LINE[10]);
        subway.addVertex("鞍山新村",subway.LINE[8]);
        subway.addVertex("鞍山新村",subway.LINE[8]);
        subway.addVertex("江浦路",subway.LINE[8]);
        subway.addVertex("江浦路",subway.LINE[8]);
        subway.addVertex("黄兴路",subway.LINE[8]);
        subway.addVertex("黄兴路",subway.LINE[8]);
        subway.addVertex("延吉中路",subway.LINE[8]);
        subway.addVertex("延吉中路",subway.LINE[8]);
        subway.addVertex("黄兴公园",subway.LINE[8]);
        subway.addVertex("黄兴公园",subway.LINE[8]);
        subway.addVertex("翔殷路",subway.LINE[8]);
        subway.addVertex("翔殷路",subway.LINE[8]);
        subway.addVertex("嫩江路",subway.LINE[8]);
        subway.addVertex("嫩江路",subway.LINE[8]);
        subway.addVertex("市光路",subway.LINE[8]);
        subway.addVertex("大世界",subway.LINE[8]);
        subway.addVertex("大世界",subway.LINE[8]);
        subway.addVertex("老西门",subway.LINE[8]);
        subway.addVertex("老西门",subway.LINE[8]);
        subway.addVertex("老西门",subway.LINE[10]);
        subway.addVertex("老西门",subway.LINE[10]);
        subway.addVertex("周家渡",subway.LINE[8]);
        subway.addVertex("周家渡",subway.LINE[8]);
        subway.addVertex("成山路",subway.LINE[8]);
        subway.addVertex("成山路",subway.LINE[8]);
        subway.addVertex("杨思",subway.LINE[8]);
        subway.addVertex("杨思",subway.LINE[8]);
        subway.addVertex("济阳路",subway.LINE[8]);
        subway.addVertex("济阳路",subway.LINE[8]);
        subway.addVertex("济阳路",subway.LINE[6]);
        subway.addVertex("凌兆新村",subway.LINE[8]);
        subway.addVertex("凌兆新村",subway.LINE[8]);
        subway.addVertex("芦恒路",subway.LINE[8]);
        subway.addVertex("芦恒路",subway.LINE[8]);
        subway.addVertex("浦江镇",subway.LINE[8]);
        subway.addVertex("浦江镇",subway.LINE[8]);
        subway.addVertex("江月路",subway.LINE[8]);
        subway.addVertex("江月路",subway.LINE[8]);
        subway.addVertex("联航路",subway.LINE[8]);
        subway.addVertex("联航路",subway.LINE[8]);
        subway.addVertex("航天博物馆",subway.LINE[8]);
        subway.addVertex("同济大学",subway.LINE[10]);
        subway.addVertex("同济大学",subway.LINE[10]);
        subway.addVertex("国权路",subway.LINE[10]);
        subway.addVertex("国权路",subway.LINE[10]);
        subway.addVertex("五角场",subway.LINE[10]);
        subway.addVertex("五角场",subway.LINE[10]);
        subway.addVertex("江湾体育场",subway.LINE[10]);
        subway.addVertex("江湾体育场",subway.LINE[10]);
        subway.addVertex("三门路",subway.LINE[10]);
        subway.addVertex("三门路",subway.LINE[10]);
        subway.addVertex("殷高东路",subway.LINE[10]);
        subway.addVertex("殷高东路",subway.LINE[10]);
        subway.addVertex("新江湾城",subway.LINE[10]);
        subway.addVertex("邮电新村",subway.LINE[10]);
        subway.addVertex("邮电新村",subway.LINE[10]);
        subway.addVertex("四川北路",subway.LINE[10]);
        subway.addVertex("四川北路",subway.LINE[10]);
        subway.addVertex("天潼路",subway.LINE[10]);
        subway.addVertex("天潼路",subway.LINE[10]);
        subway.addVertex("豫园",subway.LINE[10]);
        subway.addVertex("豫园",subway.LINE[10]);
        subway.addVertex("新天地",subway.LINE[10]);
        subway.addVertex("新天地",subway.LINE[10]);
        subway.addVertex("上海图书馆",subway.LINE[10]);
        subway.addVertex("上海图书馆",subway.LINE[10]);
        subway.addVertex("交通大学",subway.LINE[10]);
        subway.addVertex("交通大学",subway.LINE[10]);
        subway.addVertex("宋园路",subway.LINE[10]);
        subway.addVertex("宋园路",subway.LINE[10]);
        subway.addVertex("伊犁路",subway.LINE[10]);
        subway.addVertex("伊犁路",subway.LINE[10]);
        subway.addVertex("水城路",subway.LINE[10]);
        subway.addVertex("水城路",subway.LINE[10]);
        subway.addVertex("龙溪路",subway.LINE[10]);
        subway.addVertex("龙溪路",subway.LINE[10]);
        subway.addVertex("龙溪路",subway.LINE[10]);
        subway.addVertex("上海动物园",subway.LINE[10]);
        subway.addVertex("上海动物园",subway.LINE[10]);
        subway.addVertex("虹桥1号航站楼",subway.LINE[10]);
        subway.addVertex("虹桥1号航站楼",subway.LINE[10]);
        subway.addVertex("龙柏新村",subway.LINE[10]);
        subway.addVertex("龙柏新村",subway.LINE[10]);
        subway.addVertex("紫藤路",subway.LINE[10]);
        subway.addVertex("紫藤路",subway.LINE[10]);
        subway.addVertex("航中路",subway.LINE[10]);
        subway.addVertex("东靖路",subway.LINE[6]);
        subway.addVertex("东靖路",subway.LINE[6]);
        subway.addVertex("五洲大道",subway.LINE[6]);
        subway.addVertex("五洲大道",subway.LINE[6]);
        subway.addVertex("洲海路",subway.LINE[6]);
        subway.addVertex("洲海路",subway.LINE[6]);
        subway.addVertex("外高桥保税区南站",subway.LINE[6]);
        subway.addVertex("外高桥保税区南站",subway.LINE[6]);
        subway.addVertex("航津路",subway.LINE[6]);
        subway.addVertex("航津路",subway.LINE[6]);
        subway.addVertex("外高桥保税区北站",subway.LINE[6]);
        subway.addVertex("外高桥保税区北站",subway.LINE[6]);
        subway.addVertex("港城路",subway.LINE[6]);
        subway.addVertex("巨峰路",subway.LINE[6]);
        subway.addVertex("巨峰路",subway.LINE[6]);
        subway.addVertex("五莲路",subway.LINE[6]);
        subway.addVertex("五莲路",subway.LINE[6]);
        subway.addVertex("博兴路",subway.LINE[6]);
        subway.addVertex("博兴路",subway.LINE[6]);
        subway.addVertex("金桥路",subway.LINE[6]);
        subway.addVertex("金桥路",subway.LINE[6]);
        subway.addVertex("云山路",subway.LINE[6]);
        subway.addVertex("云山路",subway.LINE[6]);
        subway.addVertex("德平路",subway.LINE[6]);
        subway.addVertex("德平路",subway.LINE[6]);
        subway.addVertex("北洋泾路",subway.LINE[6]);
        subway.addVertex("北洋泾路",subway.LINE[6]);
        subway.addVertex("民生路",subway.LINE[6]);
        subway.addVertex("民生路",subway.LINE[6]);
        subway.addVertex("源生体育中心",subway.LINE[6]);
        subway.addVertex("源生体育中心",subway.LINE[6]);
        subway.addVertex("上海儿童医学中心",subway.LINE[6]);
        subway.addVertex("上海儿童医学中心",subway.LINE[6]);
        subway.addVertex("临沂新村",subway.LINE[6]);
        subway.addVertex("临沂新村",subway.LINE[6]);
        subway.addVertex("东明路",subway.LINE[6]);
        subway.addVertex("东明路",subway.LINE[6]);
        subway.addVertex("高青路",subway.LINE[6]);
        subway.addVertex("高青路",subway.LINE[6]);
        subway.addVertex("华夏西路",subway.LINE[6]);
        subway.addVertex("华夏西路",subway.LINE[6]);
        subway.addVertex("上南路",subway.LINE[6]);
        subway.addVertex("上南路",subway.LINE[6]);
        subway.addVertex("灵岩南路",subway.LINE[6]);
        subway.addVertex("灵岩南路",subway.LINE[6]);
        subway.addVertex("浦电 路",subway.LINE[6]);
        subway.addVertex("浦电 路",subway.LINE[6]);
        subway.addVertex("江杨北路",subway.LINE[3]);
        subway.addVertex("铁力路",subway.LINE[3]);
        subway.addVertex("铁力路",subway.LINE[3]);
        subway.addVertex("友谊路",subway.LINE[3]);
        subway.addVertex("友谊路",subway.LINE[3]);
        subway.addVertex("宝杨路",subway.LINE[3]);
        subway.addVertex("宝杨路",subway.LINE[3]);
        subway.addVertex("水产路",subway.LINE[3]);
        subway.addVertex("水产路",subway.LINE[3]);
        subway.addVertex("淞滨路",subway.LINE[3]);
        subway.addVertex("淞滨路",subway.LINE[3]);
        subway.addVertex("张华浜",subway.LINE[3]);
        subway.addVertex("张华浜",subway.LINE[3]);
        subway.addVertex("淞发路",subway.LINE[3]);
        subway.addVertex("淞发路",subway.LINE[3]);
        subway.addVertex("长江南路",subway.LINE[3]);
        subway.addVertex("长江南路",subway.LINE[3]);
        subway.addVertex("殷高西路",subway.LINE[3]);
        subway.addVertex("殷高西路",subway.LINE[3]);
        subway.addVertex("江湾镇",subway.LINE[3]);
        subway.addVertex("江湾镇",subway.LINE[3]);
        subway.addVertex("大柏树",subway.LINE[3]);
        subway.addVertex("大柏树",subway.LINE[3]);
        subway.addVertex("赤峰路",subway.LINE[3]);
        subway.addVertex("赤峰路",subway.LINE[3]);
        subway.addVertex("东宝兴路",subway.LINE[3]);
        subway.addVertex("东宝兴路",subway.LINE[3]);
        subway.addVertex("漕溪路",subway.LINE[3]);
        subway.addVertex("漕溪路",subway.LINE[3]);
        subway.addVertex("龙漕路",subway.LINE[3]);
        subway.addVertex("龙漕路",subway.LINE[3]);
        subway.addVertex("石龙路",subway.LINE[3]);
        subway.addVertex("石龙路",subway.LINE[3]);



        subway.addEdge("嘉定北","嘉定西",1);
        subway.addEdge("嘉定西","嘉定北",1);
        subway.addEdge("嘉定西","白银路",1);
        subway.addEdge("白银路","嘉定西",1);
        subway.addEdge("白银路","嘉定新城",1);
        subway.addEdge("嘉定新城","白银路",1);
        subway.addEdge("嘉定新城","上海赛车场",1);
        subway.addEdge("嘉定新城","马陆",1);
        subway.addEdge("上海赛车场","昌吉东路",1);
        subway.addEdge("上海赛车场","嘉定新城",1);
        subway.addEdge("昌吉东路","上海汽车城",1);
        subway.addEdge("昌吉东路","上海赛车场",1);
        subway.addEdge("上海汽车城","安亭",1);
        subway.addEdge("上海汽车城","昌吉东路",1);
        subway.addEdge("安亭","上海汽车城",1);
        subway.addEdge("马陆","嘉定新城",1);
        subway.addEdge("马陆","南翔",1);
        subway.addEdge("南翔","马陆",1);
        subway.addEdge("南翔","桃浦新村",1);
        subway.addEdge("桃浦新村","南翔",1);
        subway.addEdge("桃浦新村","武威路",1);
        subway.addEdge("武威路","桃浦新村",1);
        subway.addEdge("武威路","祁连山路",1);
        subway.addEdge("祁连山路","武威路",1);
        subway.addEdge("祁连山路","李子园",1);
        subway.addEdge("李子园","祁连山路",1);
        subway.addEdge("李子园","上海西站",1);
        subway.addEdge("上海西站","李子园",1);
        subway.addEdge("上海西站","真如",1);
        subway.addEdge("真如","上海西站",1);
        subway.addEdge("真如","枫桥路",1);
        subway.addEdge("枫桥路","真如",1);
        subway.addEdge("枫桥路","曹杨路",1);
        subway.addEdge("曹杨路","枫桥路",1);
        subway.addEdge("曹杨路","隆德路",1);
        subway.addEdge("曹杨路","镇坪路",1);
        subway.addEdge("曹杨路","金沙江路",1);
        subway.addEdge("曹杨路","镇坪路",1);
        subway.addEdge("曹杨路","金沙江路",1);
        subway.addEdge("隆德路","曹杨路",1);
        subway.addEdge("隆德路","江苏路",1);
        subway.addEdge("江苏路","隆德路",1);
        subway.addEdge("江苏路","中山公园",1);
        subway.addEdge("江苏路","静安寺",1);
        subway.addEdge("美兰湖","罗南新村",1);
        subway.addEdge("罗南新村","美兰湖",1);
        subway.addEdge("罗南新村","潘广路",1);
        subway.addEdge("潘广路","罗南新村",1);
        subway.addEdge("潘广路","刘行",1);
        subway.addEdge("刘行","潘广路",1);
        subway.addEdge("刘行","顾村公园",1);
        subway.addEdge("顾村公园","刘行",1);
        subway.addEdge("顾村公园","祁华路",1);
        subway.addEdge("祁华路","顾村公园",1);
        subway.addEdge("祁华路","上海大学",1);
        subway.addEdge("上海大学","祁华路",1);
        subway.addEdge("上海大学","南陈路",1);
        subway.addEdge("南陈路","上海大学",1);
        subway.addEdge("南陈路","上大路",1);
        subway.addEdge("上大路","南陈路",1);
        subway.addEdge("上大路","场中路",1);
        subway.addEdge("场中路","上大路",1);
        subway.addEdge("场中路","大场镇",1);
        subway.addEdge("大场镇","场中路",1);
        subway.addEdge("大场镇","行知路",1);
        subway.addEdge("行知路","大场镇",1);
        subway.addEdge("行知路","大华三路",1);
        subway.addEdge("大华三路","行知路",1);
        subway.addEdge("大华三路","新村路",1);
        subway.addEdge("新村路","大华三路",1);
        subway.addEdge("新村路","岚皋路",1);
        subway.addEdge("岚皋路","新村路",1);
        subway.addEdge("岚皋路","镇坪路",1);
        subway.addEdge("镇坪路","岚皋路",1);
        subway.addEdge("镇坪路","长寿路",1);
        subway.addEdge("镇坪路","曹杨路",1);
        subway.addEdge("镇坪路","曹杨路",1);
        subway.addEdge("镇坪路","中潭路",1);
        subway.addEdge("镇坪路","中潭路",1);
        subway.addEdge("长寿路","镇坪路",1);
        subway.addEdge("长寿路","昌平路",1);
        subway.addEdge("昌平路","长寿路",1);
        subway.addEdge("昌平路","静安寺",1);
        subway.addEdge("静安寺","昌平路",1);
        subway.addEdge("静安寺","常熟路",1);
        subway.addEdge("静安寺","江苏路",1);
        subway.addEdge("静安寺","南京西路",1);
        subway.addEdge("常熟路","静安寺",1);
        subway.addEdge("常熟路","肇家浜路",1);
        subway.addEdge("常熟路","陕西南路",1);
        subway.addEdge("常熟路","衡山路",1);
        subway.addEdge("肇家浜路","常熟路",1);
        subway.addEdge("肇家浜路","东安路",1);
        subway.addEdge("肇家浜路","徐家汇",1);
        subway.addEdge("肇家浜路","嘉善路",1);
        subway.addEdge("东安路","肇家浜路",1);
        subway.addEdge("东安路","船厂路",1);
        subway.addEdge("东安路","大木桥路",1);
        subway.addEdge("东安路","上海体育场",1);
        subway.addEdge("船厂路","东安路",1);
        subway.addEdge("船厂路","后滩",1);
        subway.addEdge("后滩","船厂路",1);
        subway.addEdge("后滩","长清路",1);
        subway.addEdge("长清路","后滩",1);
        subway.addEdge("长清路","耀华路",1);
        subway.addEdge("耀华路","长清路",1);
        subway.addEdge("耀华路","云台路",1);
        subway.addEdge("耀华路","周家渡",1);
        subway.addEdge("耀华路","成山路",1);
        subway.addEdge("云台路","耀华路",1);
        subway.addEdge("云台路","高科西路",1);
        subway.addEdge("高科西路","云台路",1);
        subway.addEdge("高科西路","杨高南路",1);
        subway.addEdge("高科西路","临沂新村",1);
        subway.addEdge("高科西路","东明路",1);
        subway.addEdge("杨高南路","高科西路",1);
        subway.addEdge("杨高南路","锦绣路",1);
        subway.addEdge("锦绣路","杨高南路",1);
        subway.addEdge("锦绣路","芳华路",1);
        subway.addEdge("芳华路","锦绣路",1);
        subway.addEdge("芳华路","龙阳路",1);
        subway.addEdge("龙阳路","芳华路",1);
        subway.addEdge("龙阳路","花木路",1);
        subway.addEdge("龙阳路","世纪公园",1);
        subway.addEdge("龙阳路","张江高科",1);
        subway.addEdge("花木路","龙阳路",1);
        subway.addEdge("中潭路","镇坪路",1);
        subway.addEdge("中潭路","镇坪路",1);
        subway.addEdge("中潭路","上海火车站",1);
        subway.addEdge("中潭路","上海火车站",1);
        subway.addEdge("上海火车站","宝山路",1);
        subway.addEdge("上海火车站","中山北路",1);
        subway.addEdge("上海火车站","汉中路",1);
        subway.addEdge("上海火车站","宝山路",1);
        subway.addEdge("上海火车站","中潭路",1);
        subway.addEdge("上海火车站","中潭路",1);
        subway.addEdge("宝山路","上海火车站",1);
        subway.addEdge("宝山路","海伦路",1);
        subway.addEdge("宝山路","东宝兴路",1);
        subway.addEdge("宝山路","上海火车站",1);
        subway.addEdge("海伦路","宝山路",1);
        subway.addEdge("海伦路","临平路",1);
        subway.addEdge("海伦路","邮电新村",1);
        subway.addEdge("海伦路","四川北路",1);
        subway.addEdge("临平路","海伦路",1);
        subway.addEdge("临平路","大连路",1);
        subway.addEdge("大连路","临平路",1);
        subway.addEdge("大连路","杨树浦路",1);
        subway.addEdge("杨树浦路","大连路",1);
        subway.addEdge("杨树浦路","浦东大道",1);
        subway.addEdge("浦东大道","杨树浦路",1);
        subway.addEdge("浦东大道","世纪大道",1);
        subway.addEdge("世纪大道","浦东大道",1);
        subway.addEdge("世纪大道","浦电路",1);
        subway.addEdge("世纪大道","东昌路",1);
        subway.addEdge("世纪大道","上海科技馆",1);
        subway.addEdge("世纪大道","商城路",1);
        subway.addEdge("世纪大道","杨高中路",1);
        subway.addEdge("世纪大道","源生体育中心",1);
        subway.addEdge("世纪大道","浦电 路",1);
        subway.addEdge("浦电路","世纪大道",1);
        subway.addEdge("浦电路","蓝村路",1);
        subway.addEdge("蓝村路","浦电路",1);
        subway.addEdge("蓝村路","塘桥",1);
        subway.addEdge("蓝村路","上海儿童医学中心",1);
        subway.addEdge("蓝村路","浦电 路",1);
        subway.addEdge("塘桥","蓝村路",1);
        subway.addEdge("塘桥","南浦大桥",1);
        subway.addEdge("南浦大桥","塘桥",1);
        subway.addEdge("南浦大桥","西藏南路",1);
        subway.addEdge("西藏南路","南浦大桥",1);
        subway.addEdge("西藏南路","鲁班路",1);
        subway.addEdge("西藏南路","陆家浜路",1);
        subway.addEdge("西藏南路","周家渡",1);
        subway.addEdge("鲁班路","西藏南路",1);
        subway.addEdge("鲁班路","大木桥路",1);
        subway.addEdge("大木桥路","鲁班路",1);
        subway.addEdge("大木桥路","东安路",1);
        subway.addEdge("上海体育场","东安路",1);
        subway.addEdge("上海体育场","上海体育馆",1);
        subway.addEdge("上海体育馆","上海体育场",1);
        subway.addEdge("上海体育馆","宜山路",1);
        subway.addEdge("上海体育馆","徐家汇",1);
        subway.addEdge("上海体育馆","漕宝路",1);
        subway.addEdge("宜山路","上海体育馆",1);
        subway.addEdge("宜山路","虹桥路",1);
        subway.addEdge("宜山路","徐家汇",1);
        subway.addEdge("宜山路","桂林路",1);
        subway.addEdge("宜山路","漕溪路",1);
        subway.addEdge("宜山路","虹桥路",1);
        subway.addEdge("虹桥路","宜山路",1);
        subway.addEdge("虹桥路","延安西路",1);
        subway.addEdge("虹桥路","交通大学",1);
        subway.addEdge("虹桥路","宋园路",1);
        subway.addEdge("虹桥路","延安西路",1);
        subway.addEdge("虹桥路","宜山路",1);
        subway.addEdge("延安西路","虹桥路",1);
        subway.addEdge("延安西路","中山公园",1);
        subway.addEdge("延安西路","虹桥路",1);
        subway.addEdge("延安西路","中山公园",1);
        subway.addEdge("中山公园","延安西路",1);
        subway.addEdge("中山公园","金沙江路",1);
        subway.addEdge("中山公园","江苏路",1);
        subway.addEdge("中山公园","娄山关路",1);
        subway.addEdge("中山公园","金沙江路",1);
        subway.addEdge("中山公园","延安西路",1);
        subway.addEdge("金沙江路","中山公园",1);
        subway.addEdge("金沙江路","曹杨路",1);
        subway.addEdge("金沙江路","曹杨路",1);
        subway.addEdge("金沙江路","中山公园",1);
        subway.addEdge("南京西路","静安寺",1);
        subway.addEdge("南京西路","人民广场",1);
        subway.addEdge("人民广场","南京西路",1);
        subway.addEdge("人民广场","南京东路",1);
        subway.addEdge("人民广场","新闸路",1);
        subway.addEdge("人民广场","黄陂南路",1);
        subway.addEdge("人民广场","曲阜路",1);
        subway.addEdge("人民广场","大世界",1);
        subway.addEdge("南京东路","人民广场",1);
        subway.addEdge("南京东路","陆家嘴",1);
        subway.addEdge("南京东路","天潼路",1);
        subway.addEdge("南京东路","豫园",1);
        subway.addEdge("陆家嘴","南京东路",1);
        subway.addEdge("陆家嘴","东昌路",1);
        subway.addEdge("东昌路","陆家嘴",1);
        subway.addEdge("东昌路","世纪大道",1);
        subway.addEdge("娄山关路","威宁路",1);
        subway.addEdge("娄山关路","中山公园",1);
        subway.addEdge("威宁路","北新泾",1);
        subway.addEdge("威宁路","娄山关路",1);
        subway.addEdge("北新泾","淞虹路",1);
        subway.addEdge("北新泾","威宁路",1);
        subway.addEdge("淞虹路","虹桥2号航站楼",1);
        subway.addEdge("淞虹路","北新泾",1);
        subway.addEdge("虹桥2号航站楼","虹桥火车站",1);
        subway.addEdge("虹桥2号航站楼","淞虹路",1);
        subway.addEdge("虹桥2号航站楼","虹桥1号航站楼",1);
        subway.addEdge("虹桥火车站","徐泾东",1);
        subway.addEdge("虹桥火车站","虹桥2号航站楼",1);
        subway.addEdge("徐泾东","虹桥火车站",1);
        subway.addEdge("上海科技馆","世纪大道",1);
        subway.addEdge("上海科技馆","世纪公园",1);
        subway.addEdge("世纪公园","上海科技馆",1);
        subway.addEdge("世纪公园","龙阳路",1);
        subway.addEdge("张江高科","龙阳路",1);
        subway.addEdge("张江高科","金科路",1);
        subway.addEdge("金科路","张江高科",1);
        subway.addEdge("金科路","广兰路",1);
        subway.addEdge("唐镇","广兰路",1);
        subway.addEdge("唐镇","创新中路",1);
        subway.addEdge("广兰路","金科路",1);
        subway.addEdge("广兰路","唐镇",1);
        subway.addEdge("创新中路","唐镇",1);
        subway.addEdge("创新中路","华夏东路",1);
        subway.addEdge("华夏东路","创新中路",1);
        subway.addEdge("华夏东路","川沙",1);
        subway.addEdge("川沙","华夏东路",1);
        subway.addEdge("川沙","凌空路",1);
        subway.addEdge("凌空路","川沙",1);
        subway.addEdge("凌空路","远东大道",1);
        subway.addEdge("远东大道","凌空路",1);
        subway.addEdge("远东大道","海天三路",1);
        subway.addEdge("海天三路","远东大道",1);
        subway.addEdge("海天三路","浦东国际机场",1);
        subway.addEdge("浦东国际机场","海天三路",1);
        subway.addEdge("富锦路","友谊西路",1);
        subway.addEdge("友谊西路","富锦路",1);
        subway.addEdge("友谊西路","宝安公路",1);
        subway.addEdge("宝安公路","友谊西路",1);
        subway.addEdge("宝安公路","共富新村",1);
        subway.addEdge("共富新村","宝安公路",1);
        subway.addEdge("共富新村","呼兰路",1);
        subway.addEdge("呼兰路","共富新村",1);
        subway.addEdge("呼兰路","通河新村",1);
        subway.addEdge("通河新村","呼兰路",1);
        subway.addEdge("通河新村","共康路",1);
        subway.addEdge("共康路","通河新村",1);
        subway.addEdge("共康路","彭浦新村",1);
        subway.addEdge("彭浦新村","共康路",1);
        subway.addEdge("彭浦新村","汶水路",1);
        subway.addEdge("汶水路","彭浦新村",1);
        subway.addEdge("汶水路","上海马戏城",1);
        subway.addEdge("上海马戏城","汶水路",1);
        subway.addEdge("上海马戏城","延长路",1);
        subway.addEdge("延长路","上海马戏城",1);
        subway.addEdge("延长路","中山北路",1);
        subway.addEdge("中山北路","延长路",1);
        subway.addEdge("中山北路","上海火车站",1);
        subway.addEdge("汉中路","上海火车站",1);
        subway.addEdge("汉中路","新闸路",1);
        subway.addEdge("新闸路","汉中路",1);
        subway.addEdge("新闸路","人民广场",1);
        subway.addEdge("黄陂南路","人民广场",1);
        subway.addEdge("黄陂南路","陕西南路",1);
        subway.addEdge("陕西南路","黄陂南路",1);
        subway.addEdge("陕西南路","常熟路",1);
        subway.addEdge("陕西南路","新天地",1);
        subway.addEdge("陕西南路","上海图书馆",1);
        subway.addEdge("衡山路","常熟路",1);
        subway.addEdge("衡山路","徐家汇",1);
        subway.addEdge("徐家汇","衡山路",1);
        subway.addEdge("徐家汇","上海体育馆",1);
        subway.addEdge("徐家汇","宜山路",1);
        subway.addEdge("徐家汇","肇家浜路",1);
        subway.addEdge("漕宝路","上海体育馆",1);
        subway.addEdge("漕宝路","上海南站",1);
        subway.addEdge("上海南站","漕宝路",1);
        subway.addEdge("上海南站","锦江乐园",1);
        subway.addEdge("上海南站","石龙路",1);
        subway.addEdge("锦江乐园","上海南站",1);
        subway.addEdge("锦江乐园","莲花路",1);
        subway.addEdge("莲花路","锦江乐园",1);
        subway.addEdge("莲花路","外环路",1);
        subway.addEdge("外环路","莲花路",1);
        subway.addEdge("外环路","莘庄",1);
        subway.addEdge("莘庄","外环路",1);
        subway.addEdge("莘庄","春申路",1);
        subway.addEdge("嘉善路","肇家浜路",1);
        subway.addEdge("嘉善路","打浦桥",1);
        subway.addEdge("打浦桥","嘉善路",1);
        subway.addEdge("打浦桥","马当路",1);
        subway.addEdge("马当路","打浦桥",1);
        subway.addEdge("马当路","陆家浜路",1);
        subway.addEdge("陆家浜路","马当路",1);
        subway.addEdge("陆家浜路","小南门",1);
        subway.addEdge("陆家浜路","老西门",1);
        subway.addEdge("陆家浜路","西藏南路",1);
        subway.addEdge("小南门","陆家浜路",1);
        subway.addEdge("小南门","商城路",1);
        subway.addEdge("商城路","小南门",1);
        subway.addEdge("商城路","世纪大道",1);
        subway.addEdge("桂林路","漕河泾开发区",1);
        subway.addEdge("桂林路","宜山路",1);
        subway.addEdge("漕河泾开发区","合川路",1);
        subway.addEdge("漕河泾开发区","桂林路",1);
        subway.addEdge("合川路","星中路",1);
        subway.addEdge("合川路","漕河泾开发区",1);
        subway.addEdge("星中路","七宝",1);
        subway.addEdge("星中路","合川路",1);
        subway.addEdge("七宝","中春路",1);
        subway.addEdge("七宝","星中路",1);
        subway.addEdge("中春路","九亭",1);
        subway.addEdge("中春路","七宝",1);
        subway.addEdge("九亭","泗泾",1);
        subway.addEdge("九亭","中春路",1);
        subway.addEdge("泗泾","佘山",1);
        subway.addEdge("泗泾","九亭",1);
        subway.addEdge("佘山","洞泾",1);
        subway.addEdge("佘山","泗泾",1);
        subway.addEdge("洞泾","松江大学城",1);
        subway.addEdge("洞泾","佘山",1);
        subway.addEdge("松江大学城","松江新城",1);
        subway.addEdge("松江大学城","洞泾",1);
        subway.addEdge("松江新城","松江大学城",1);
        subway.addEdge("春申路","莘庄",1);
        subway.addEdge("春申路","银都路",1);
        subway.addEdge("银都路","春申路",1);
        subway.addEdge("银都路","颛桥",1);
        subway.addEdge("颛桥","银都路",1);
        subway.addEdge("颛桥","北桥",1);
        subway.addEdge("北桥","颛桥",1);
        subway.addEdge("北桥","剑川路",1);
        subway.addEdge("剑川路","北桥",1);
        subway.addEdge("剑川路","东川路",1);
        subway.addEdge("东川路","剑川路",1);
        subway.addEdge("东川路","金平路",1);
        subway.addEdge("金平路","东川路",1);
        subway.addEdge("金平路","华宁路",1);
        subway.addEdge("华宁路","金平路",1);
        subway.addEdge("华宁路","文井路",1);
        subway.addEdge("闵行开发区","文井路",1);
        subway.addEdge("文井路","华宁路",1);
        subway.addEdge("文井路","闵行开发区",1);
        subway.addEdge("杨高中路","世纪大道",1);
        subway.addEdge("中兴路","西藏北路",1);
        subway.addEdge("中兴路","曲阜路",1);
        subway.addEdge("西藏北路","虹口足球场",1);
        subway.addEdge("西藏北路","中兴路",1);
        subway.addEdge("曲阜路","中兴路",1);
        subway.addEdge("曲阜路","人民广场",1);
        subway.addEdge("虹口足球场","曲阳路",1);
        subway.addEdge("虹口足球场","西藏北路",1);
        subway.addEdge("虹口足球场","赤峰路",1);
        subway.addEdge("虹口足球场","东宝兴路",1);
        subway.addEdge("曲阳路","四平路",1);
        subway.addEdge("曲阳路","虹口足球场",1);
        subway.addEdge("四平路","鞍山新村",1);
        subway.addEdge("四平路","曲阳路",1);
        subway.addEdge("四平路","同济大学",1);
        subway.addEdge("四平路","邮电新村",1);
        subway.addEdge("鞍山新村","江浦路",1);
        subway.addEdge("鞍山新村","四平路",1);
        subway.addEdge("江浦路","黄兴路",1);
        subway.addEdge("江浦路","鞍山新村",1);
        subway.addEdge("黄兴路","延吉中路",1);
        subway.addEdge("黄兴路","江浦路",1);
        subway.addEdge("延吉中路","黄兴公园",1);
        subway.addEdge("延吉中路","黄兴路",1);
        subway.addEdge("黄兴公园","翔殷路",1);
        subway.addEdge("黄兴公园","延吉中路",1);
        subway.addEdge("翔殷路","黄兴公园",1);
        subway.addEdge("翔殷路","嫩江路",1);
        subway.addEdge("嫩江路","市光路",1);
        subway.addEdge("嫩江路","翔殷路",1);
        subway.addEdge("市光路","嫩江路",1);
        subway.addEdge("大世界","人民广场",1);
        subway.addEdge("大世界","老西门",1);
        subway.addEdge("老西门","大世界",1);
        subway.addEdge("老西门","陆家浜路",1);
        subway.addEdge("老西门","豫园",1);
        subway.addEdge("老西门","新天地",1);
        subway.addEdge("周家渡","西藏南路",1);
        subway.addEdge("周家渡","耀华路",1);
        subway.addEdge("成山路","耀华路",1);
        subway.addEdge("成山路","杨思",1);
        subway.addEdge("杨思","成山路",1);
        subway.addEdge("杨思","济阳路",1);
        subway.addEdge("济阳路","杨思",1);
        subway.addEdge("济阳路","凌兆新村",1);
        subway.addEdge("济阳路","灵岩南路",1);
        subway.addEdge("凌兆新村","济阳路",1);
        subway.addEdge("凌兆新村","芦恒路",1);
        subway.addEdge("芦恒路","凌兆新村",1);
        subway.addEdge("芦恒路","浦江镇",1);
        subway.addEdge("浦江镇","芦恒路",1);
        subway.addEdge("浦江镇","江月路",1);
        subway.addEdge("江月路","浦江镇",1);
        subway.addEdge("江月路","联航路",1);
        subway.addEdge("联航路","江月路",1);
        subway.addEdge("联航路","航天博物馆",1);
        subway.addEdge("航天博物馆","联航路",1);
        subway.addEdge("同济大学","国权路",1);
        subway.addEdge("同济大学","四平路",1);
        subway.addEdge("国权路","五角场",1);
        subway.addEdge("国权路","同济大学",1);
        subway.addEdge("五角场","江湾体育场",1);
        subway.addEdge("五角场","国权路",1);
        subway.addEdge("江湾体育场","三门路",1);
        subway.addEdge("江湾体育场","五角场",1);
        subway.addEdge("三门路","江湾体育场",1);
        subway.addEdge("三门路","殷高东路",1);
        subway.addEdge("殷高东路","新江湾城",1);
        subway.addEdge("殷高东路","三门路",1);
        subway.addEdge("新江湾城","殷高东路",1);
        subway.addEdge("邮电新村","四平路",1);
        subway.addEdge("邮电新村","海伦路",1);
        subway.addEdge("四川北路","海伦路",1);
        subway.addEdge("四川北路","天潼路",1);
        subway.addEdge("天潼路","四川北路",1);
        subway.addEdge("天潼路","南京东路",1);
        subway.addEdge("豫园","南京东路",1);
        subway.addEdge("豫园","老西门",1);
        subway.addEdge("新天地","老西门",1);
        subway.addEdge("新天地","陕西南路",1);
        subway.addEdge("上海图书馆","陕西南路",1);
        subway.addEdge("上海图书馆","交通大学",1);
        subway.addEdge("交通大学","上海图书馆",1);
        subway.addEdge("交通大学","虹桥路",1);
        subway.addEdge("宋园路","虹桥路",1);
        subway.addEdge("宋园路","伊犁路",1);
        subway.addEdge("伊犁路","宋园路",1);
        subway.addEdge("伊犁路","水城路",1);
        subway.addEdge("水城路","伊犁路",1);
        subway.addEdge("水城路","龙溪路",1);
        subway.addEdge("龙溪路","水城路",1);
        subway.addEdge("龙溪路","上海动物园",1);
        subway.addEdge("龙溪路","龙柏新村",1);
        subway.addEdge("上海动物园","龙溪路",1);
        subway.addEdge("上海动物园","虹桥1号航站楼",1);
        subway.addEdge("虹桥1号航站楼","虹桥2号航站楼",1);
        subway.addEdge("虹桥1号航站楼","上海动物园",1);
        subway.addEdge("龙柏新村","龙溪路",1);
        subway.addEdge("龙柏新村","紫藤路",1);
        subway.addEdge("紫藤路","龙柏新村",1);
        subway.addEdge("紫藤路","航中路",1);
        subway.addEdge("航中路","紫藤路",1);
        subway.addEdge("东靖路","五洲大道",1);
        subway.addEdge("东靖路","巨峰路",1);
        subway.addEdge("五洲大道","洲海路",1);
        subway.addEdge("五洲大道","东靖路",1);
        subway.addEdge("洲海路","外高桥保税区南站",1);
        subway.addEdge("洲海路","五洲大道",1);
        subway.addEdge("外高桥保税区南站","航津路",1);
        subway.addEdge("外高桥保税区南站","洲海路",1);
        subway.addEdge("航津路","外高桥保税区南站",1);
        subway.addEdge("航津路","外高桥保税区北站",1);
        subway.addEdge("外高桥保税区北站","港城路",1);
        subway.addEdge("外高桥保税区北站","航津路",1);
        subway.addEdge("港城路","外高桥保税区北站",1);
        subway.addEdge("巨峰路","东靖路",1);
        subway.addEdge("巨峰路","五莲路",1);
        subway.addEdge("五莲路","巨峰路",1);
        subway.addEdge("五莲路","博兴路",1);
        subway.addEdge("博兴路","五莲路",1);
        subway.addEdge("博兴路","金桥路",1);
        subway.addEdge("金桥路","博兴路",1);
        subway.addEdge("金桥路","云山路",1);
        subway.addEdge("云山路","金桥路",1);
        subway.addEdge("云山路","德平路",1);
        subway.addEdge("德平路","云山路",1);
        subway.addEdge("德平路","北洋泾路",1);
        subway.addEdge("北洋泾路","德平路",1);
        subway.addEdge("北洋泾路","民生路",1);
        subway.addEdge("民生路","北洋泾路",1);
        subway.addEdge("民生路","源生体育中心",1);
        subway.addEdge("源生体育中心","民生路",1);
        subway.addEdge("源生体育中心","世纪大道",1);
        subway.addEdge("上海儿童医学中心","蓝村路",1);
        subway.addEdge("上海儿童医学中心","临沂新村",1);
        subway.addEdge("临沂新村","上海儿童医学中心",1);
        subway.addEdge("临沂新村","高科西路",1);
        subway.addEdge("东明路","高科西路",1);
        subway.addEdge("东明路","高青路",1);
        subway.addEdge("高青路","东明路",1);
        subway.addEdge("高青路","华夏西路",1);
        subway.addEdge("华夏西路","高青路",1);
        subway.addEdge("华夏西路","上南路",1);
        subway.addEdge("上南路","华夏西路",1);
        subway.addEdge("上南路","灵岩南路",1);
        subway.addEdge("灵岩南路","上南路",1);
        subway.addEdge("灵岩南路","济阳路",1);
        subway.addEdge("浦电 路","世纪大道",1);
        subway.addEdge("浦电 路","蓝村路",1);
        subway.addEdge("江杨北路","铁力路",1);
        subway.addEdge("铁力路","江杨北路",1);
        subway.addEdge("铁力路","友谊路",1);
        subway.addEdge("友谊路","铁力路",1);
        subway.addEdge("友谊路","宝杨路",1);
        subway.addEdge("宝杨路","友谊路",1);
        subway.addEdge("宝杨路","水产路",1);
        subway.addEdge("水产路","宝杨路",1);
        subway.addEdge("水产路","淞滨路",1);
        subway.addEdge("淞滨路","水产路",1);
        subway.addEdge("淞滨路","张华浜",1);
        subway.addEdge("张华浜","淞滨路",1);
        subway.addEdge("张华浜","淞发路",1);
        subway.addEdge("淞发路","张华浜",1);
        subway.addEdge("淞发路","长江南路",1);
        subway.addEdge("长江南路","淞发路",1);
        subway.addEdge("长江南路","殷高西路",1);
        subway.addEdge("殷高西路","长江南路",1);
        subway.addEdge("殷高西路","江湾镇",1);
        subway.addEdge("江湾镇","殷高西路",1);
        subway.addEdge("江湾镇","大柏树",1);
        subway.addEdge("大柏树","江湾镇",1);
        subway.addEdge("大柏树","赤峰路",1);
        subway.addEdge("赤峰路","大柏树",1);
        subway.addEdge("赤峰路","虹口足球场",1);
        subway.addEdge("东宝兴路","虹口足球场",1);
        subway.addEdge("东宝兴路","宝山路",1);
        subway.addEdge("漕溪路","宜山路",1);
        subway.addEdge("漕溪路","龙漕路",1);
        subway.addEdge("龙漕路","漕溪路",1);
        subway.addEdge("龙漕路","石龙路",1);
        subway.addEdge("石龙路","龙漕路",1);
        subway.addEdge("石龙路","上海南站",1);
    }

    MediaClass(){
        subwayGraph = new Graph();
        buildVertex(*subwayGraph);
    }

    MediaClass(Graph * graph){
        subwayGraph = graph;
    }

    std::string source(){
        return src;
    }

    void setSource(std::string newsrc){
        src = newsrc;
    }

    std::string dest(){
        return des;
    }

    void setDest(std::string newdes){
        des = newdes;
    }

    QList<QString>list(){
        return m_list;
    }

    void setSubwayGraph(Graph * graph){
        subwayGraph = graph;
    }

    Q_INVOKABLE void shortestPath(QString dest, QString source){
        std::string left = dest.toUtf8().constData();
        std::string right = source.toUtf8().constData();
        List<VertexandEdge *> * result = subwayGraph->DijkstraShortestPath(&left, &right);

        m_list.clear();

        for(Node<VertexandEdge *> * pointer = result->frontPointer(); pointer != NULL; pointer = pointer->next){
            const char * str = pointer->value->vertex->getName().c_str();
            QString qstr(str);
            m_list.push_back(qstr);
        }
    }

    Q_INVOKABLE void addVertex(QString vertexName, QString preName, QString postName){
        std::string vertexname = vertexName.toUtf8().constData();
        std::string prename = preName.toUtf8().constData();
        std::string postname = postName.toUtf8().constData();
        subwayGraph->addVertex(vertexname,subwayGraph->LINE[16]);
        subwayGraph->addEdge(vertexname,prename,1);
        subwayGraph->addEdge(vertexname,postname,1);
    }

signals:
    void sourceChanged(std::string & source);
    void destChanged(std::string & dest);
private:
    std::string src;
    std::string des;
    QList<QString>m_list;
    Graph * subwayGraph;
};


#endif
